﻿#pragma once


#include <QDialog>
#include <QPushButton>
#include "QListView"
#include "QStringListModel"
#include "QFileDialog"
#include "QMessageBox"
#include "QApplication"
#include "QVBoxLayout"
#include <QDesktopWidget>
#include <QLibrary>
#include <QApplication>
#include <QFrame>
#include <QLabel>
#include <QComboBox>
#include "QListView"
#include "QStringListModel"
#include "QLineEdit"
#include "QSpinBox"
#include <QSettings>

#include "commonfunction.h"

#include "halcon_opencv.h"

using namespace std;

#include "qt_graphics_view.h"
#include "function_create_shape_model.h"


class FunctionFindShapeModel :public QDialog
{
public:
    QSettings* m_qsettings;
    Mat m_image ,m_image_show;
    QString m_section   = "";

    FunctionCreateShapeModel* m_create_shape_model;

    QLabel*   m_qlabel_score_standard;
    QDoubleSpinBox* m_qdoublespinbox_score_standard;
    double    m_score_standard=0;


	QPushButton* m_pushbutton_show_orign_image;
    //QPushButton* m_pushbutton_new_model;
    QPushButton* m_pushbutton_edit_model;
    QPushButton* m_pushbutton_detection;
    QPushButton* m_pushbutton_save_parameter;
    QPushButton* m_pushbutton_return;


    QtQGraphicsView* m_view ;
    QLabel*          m_view_pixel_qlabel;

    HObject m_xld_show;

public:
    explicit FunctionFindShapeModel(QDialog *parent = nullptr, QSettings* qsettings = nullptr,QString section="",QString dir="") ;
    ~FunctionFindShapeModel() ;
    void detectionImage();
    bool detection( HObject image_in, QString& message);
    void draw( Mat image_in,Mat& image_out);
    void loadParameter();
    void saveParameter();
    bool showDialog();
};
#pragma execution_character_set("utf-8")
